package com.billsystem.service;

import com.billsystem.mapper.AccountMapper;
import com.billsystem.pojo.Account;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountService {

    @Autowired
    private AccountMapper accountMapper;
    /*
    增添账户信息
     */
    public void addAccount(Account account){
        accountMapper.addAccount(account);
    }

    /*
    删除账户信息
     */
    public void deleteAccount(Account account){
        accountMapper.deleteAccount(account);
    }

    /*
    根据id查询账户信息
     */
    public Account queryAccount(int id){
        return accountMapper.queryAccount(id);
    }
    /*
    根据用户id查询账户信息
     */
    public List<Account> queryListByUid(int uid){
        return accountMapper.queryListByUid(uid);
    }
    /*
    修改账户信息
     */
    public void updateAccount(Account account){
        accountMapper.updateAccount(account);
    }

}
